package com.bigflexlib.ds.op
{


	import com.bigflexlib.ds.container.IRContainer;
	import com.bigflexlib.ds.container.bag.IWBag;


	public class BagFilterOp extends AbstractContainerFilterOp
	{
		
		
		private var oBag:IWBag;
		
		
		/**
		 * 
		 * @param iContainer 
		 * 		You can pass any container. Not just a Bag. It will work just fine.
		 * 
		 * @param oBag
		 * @param iFilterFunction
		 * 
		 */		
		public function BagFilterOp( iContainer:IRContainer, oBag:IWBag, iFilterFunction:Function )
		{

			this.oBag = oBag;

			super(iContainer, oBag, iFilterFunction);
			

		}
		
		

		override protected function m( e:*, m:int ):void
		{
		
			oBag.add( e , m );		
		
		}
		
		
		override public function dispose( ):void
		{
			
			super.dispose();
			
			oBag = null;
		
		}
		
		
	}
}